/*
 * Copyright (C) 2013 Roy Wang
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.mogujie.coverflowsample.slice;

import com.dolphinwang.imagecoverflow.CoverFlowAdapter;
import com.mogujie.coverflowsample.ResourceTable;
import com.mogujie.coverflowsample.utils.ResourceUtils;

import ohos.app.Context;
import ohos.media.image.PixelMap;

import java.util.ArrayList;
import java.util.List;

/**
 * My Cover FlowAdapter
 */
public class MyCoverFlowAdapter extends CoverFlowAdapter {
    private List<PixelMap> mBitmapList = new ArrayList<>();

    public MyCoverFlowAdapter(Context context) {
        PixelMap image1 = ResourceUtils.getPixelMap(context, ResourceTable.Media_footprint_header_bg1).get();
        mBitmapList.add(image1);
        mBitmapList.add(image1);
        mBitmapList.add(image1);
        mBitmapList.add(image1);
        mBitmapList.add(image1);
        mBitmapList.add(image1);
        mBitmapList.add(image1);
    }

    @Override
    public int getCount() {
        return mBitmapList.size();
    }

    @Override
    public PixelMap getImage(final int position) {
        return mBitmapList.get(position);
    }
}
